<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>高德地图绘制矢量图 | Joey</title><meta name="keywords" content="地图,高德地图"><meta name="author" content="方陈勇"><meta name="copyright" content="方陈勇"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="从原来的腾讯地图替换为高德地图">
<meta property="og:type" content="article">
<meta property="og:title" content="高德地图绘制矢量图">
<meta property="og:url" content="http://fangchenyong.top/2019/12/19/%E5%9C%B0%E5%9B%BE-%E9%AB%98%E5%BE%B7%E5%9C%B0%E5%9B%BE%E7%94%BB%E7%82%B9%E3%80%81%E6%8A%98%E7%BA%BF%E3%80%81%E5%A4%9A%E8%BE%B9%E5%BD%A2%E3%80%81%E9%95%BF%E6%96%B9%E5%BD%A2%E3%80%81%E5%9C%86/index.html">
<meta property="og:site_name" content="Joey">
<meta property="og:description" content="从原来的腾讯地图替换为高德地图">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG">
<meta property="article:published_time" content="2019-12-19T14:12:23.000Z">
<meta property="article:modified_time" content="2020-05-22T10:05:31.203Z">
<meta property="article:author" content="方陈勇">
<meta property="article:tag" content="地图">
<meta property="article:tag" content="高德地图">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://fangchenyong.top/2019/12/19/%E5%9C%B0%E5%9B%BE-%E9%AB%98%E5%BE%B7%E5%9C%B0%E5%9B%BE%E7%94%BB%E7%82%B9%E3%80%81%E6%8A%98%E7%BA%BF%E3%80%81%E5%A4%9A%E8%BE%B9%E5%BD%A2%E3%80%81%E9%95%BF%E6%96%B9%E5%BD%A2%E3%80%81%E5%9C%86/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2020-05-22 18:05:31'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    })(window)</script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/3FD9B055-6361-49B7-B8CE-5BA9144BD27F.JPG" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">40</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">47</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">49</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Joey</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">高德地图绘制矢量图</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2019-12-19T14:12:23.000Z" title="发表于 2019-12-19 22:12:23">2019-12-19</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2020-05-22T10:05:31.203Z" title="更新于 2020-05-22 18:05:31">2020-05-22</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%9C%B0%E5%9B%BE/">地图</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%9C%B0%E5%9B%BE/%E9%AB%98%E5%BE%B7%E5%9C%B0%E5%9B%BE/">高德地图</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">2.6k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>14分钟</span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="高德地图绘制矢量图"><a href="#高德地图绘制矢量图" class="headerlink" title="高德地图绘制矢量图"></a>高德地图绘制矢量图</h1><h1 id="地图坐标选取器"><a href="#地图坐标选取器" class="headerlink" title="地图坐标选取器"></a>地图坐标选取器</h1><figure class="highlight html"><table><tr><td class="code"><pre><span class="line"><span class="meta">&lt;!doctype <span class="meta-keyword">html</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">html</span> <span class="attr">lang</span>=<span class="string">&quot;en&quot;</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">head</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">meta</span> <span class="attr">charset</span>=<span class="string">&quot;utf-8&quot;</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">meta</span> <span class="attr">http-equiv</span>=<span class="string">&quot;X-UA-Compatible&quot;</span> <span class="attr">content</span>=<span class="string">&quot;chrome=1&quot;</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">meta</span> <span class="attr">name</span>=<span class="string">&quot;viewport&quot;</span> <span class="attr">content</span>=<span class="string">&quot;initial-scale=1.0, user-scalable=no, width=device-width&quot;</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">style</span>&gt;</span></span><br><span class="line"><span class="css">        <span class="selector-tag">html</span>, <span class="selector-tag">body</span>, <span class="selector-id">#container</span> &#123;</span></span><br><span class="line"><span class="css">            <span class="attribute">height</span>: <span class="number">100%</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">width</span>: <span class="number">100%</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">font-size</span>: <span class="number">14px</span>;</span></span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line"><span class="css">        <span class="selector-tag">body</span> &#123;</span></span><br><span class="line"><span class="css">            <span class="attribute">margin</span>: <span class="number">0</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">font-family</span>: -apple-system, BlinkMacSystemFont, <span class="string">&quot;Segoe UI&quot;</span>, Roboto, <span class="string">&quot;Helvetica Neue&quot;</span>, Arial, sans-serif, <span class="string">&quot;Apple Color Emoji&quot;</span>, <span class="string">&quot;Segoe UI Emoji&quot;</span>, <span class="string">&quot;Segoe UI Symbol&quot;</span>, <span class="string">&quot;Noto Color Emoji&quot;</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">line-height</span>: <span class="number">1.5</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">font-weight</span>: <span class="number">300</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">color</span>: <span class="number">#111213</span>;</span></span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        * &#123;</span><br><span class="line"><span class="css">            <span class="attribute">box-sizing</span>: border-box;</span></span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        .input-item &#123;</span><br><span class="line"><span class="css">            <span class="attribute">position</span>: relative;</span></span><br><span class="line"><span class="css">            <span class="attribute">display</span>: -ms-flexbox;</span></span><br><span class="line"><span class="css">            <span class="attribute">display</span>: flex;</span></span><br><span class="line"><span class="css">            -ms-<span class="attribute">flex-wrap</span>: wrap;</span></span><br><span class="line"><span class="css">            <span class="attribute">flex-wrap</span>: wrap;</span></span><br><span class="line"><span class="css">            -ms-<span class="attribute">flex</span>-align: center;</span></span><br><span class="line"><span class="css">            <span class="attribute">align-items</span>: center;</span></span><br><span class="line"><span class="css">            <span class="attribute">width</span>: <span class="number">100%</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">height</span>: <span class="number">2.2rem</span>;</span></span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        .info &#123;</span><br><span class="line"><span class="css">            <span class="attribute">padding</span>: .<span class="number">75rem</span> <span class="number">1.25rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">margin-bottom</span>: <span class="number">1rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">border-radius</span>: .<span class="number">25rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">position</span>: fixed;</span></span><br><span class="line"><span class="css">            <span class="attribute">top</span>: <span class="number">1rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">background-color</span>: white;</span></span><br><span class="line"><span class="css">            <span class="attribute">width</span>: auto;</span></span><br><span class="line"><span class="css">            <span class="attribute">min-width</span>: <span class="number">22rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">border-width</span>: <span class="number">0</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">left</span>: <span class="number">1rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">right</span>: auto;</span></span><br><span class="line"><span class="css">            <span class="attribute">box-shadow</span>: <span class="number">0</span> <span class="number">2px</span> <span class="number">6px</span> <span class="number">0</span> <span class="built_in">rgba</span>(<span class="number">114</span>, <span class="number">124</span>, <span class="number">245</span>, .<span class="number">5</span>);</span></span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        .input-card &#123;</span><br><span class="line"><span class="css">            <span class="attribute">display</span>: flex;</span></span><br><span class="line"><span class="css">            <span class="attribute">flex-direction</span>: column;</span></span><br><span class="line"><span class="css">            <span class="attribute">min-width</span>: <span class="number">0</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">word-wrap</span>: break-word;</span></span><br><span class="line"><span class="css">            <span class="attribute">background-color</span>: <span class="number">#fff</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">background-clip</span>: border-box;</span></span><br><span class="line"><span class="css">            <span class="attribute">border-radius</span>: .<span class="number">25rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">width</span>: <span class="number">22rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">border-width</span>: <span class="number">0</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">box-shadow</span>: <span class="number">0</span> <span class="number">2px</span> <span class="number">6px</span> <span class="number">0</span> <span class="built_in">rgba</span>(<span class="number">114</span>, <span class="number">124</span>, <span class="number">245</span>, .<span class="number">5</span>);</span></span><br><span class="line"><span class="css">            <span class="attribute">position</span>: fixed;</span></span><br><span class="line"><span class="css">            <span class="attribute">bottom</span>: <span class="number">1rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">right</span>: <span class="number">1rem</span>;</span></span><br><span class="line"><span class="css">            -ms-<span class="attribute">flex</span>: <span class="number">1</span> <span class="number">1</span> auto;</span></span><br><span class="line"><span class="css">            <span class="attribute">flex</span>: <span class="number">1</span> <span class="number">1</span> auto;</span></span><br><span class="line"><span class="css">            <span class="attribute">padding</span>: <span class="number">0.75rem</span> <span class="number">1.25rem</span>;</span></span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        .btn &#123;</span><br><span class="line"><span class="css">            <span class="attribute">width</span>: <span class="number">6rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">margin</span>: <span class="number">0</span> <span class="number">1rem</span> <span class="number">0</span> <span class="number">2rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">display</span>: inline-block;</span></span><br><span class="line"><span class="css">            <span class="attribute">font-weight</span>: <span class="number">400</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">text-align</span>: center;</span></span><br><span class="line"><span class="css">            <span class="attribute">white-space</span>: nowrap;</span></span><br><span class="line"><span class="css">            <span class="attribute">vertical-align</span>: middle;</span></span><br><span class="line"><span class="css">            -webkit-user-select: none;</span></span><br><span class="line"><span class="css">            -moz-user-select: none;</span></span><br><span class="line"><span class="css">            -ms-user-select: none;</span></span><br><span class="line"><span class="css">            user-select: none;</span></span><br><span class="line"><span class="css">            <span class="attribute">border</span>: <span class="number">1px</span> solid transparent;</span></span><br><span class="line"><span class="css">            <span class="attribute">transition</span>: color .<span class="number">15s</span> ease-in-out, background-color .<span class="number">15s</span> ease-in-out, border-color .<span class="number">15s</span> ease-in-out, box-shadow .<span class="number">15s</span> ease-in-out;</span></span><br><span class="line"><span class="css">            <span class="attribute">background-color</span>: transparent;</span></span><br><span class="line"><span class="css">            <span class="attribute">background-image</span>: none;</span></span><br><span class="line"><span class="css">            <span class="attribute">color</span>: <span class="number">#25A5F7</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">border-color</span>: <span class="number">#25A5F7</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">padding</span>: .<span class="number">25rem</span> .<span class="number">5rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">line-height</span>: <span class="number">1.5</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">border-radius</span>: <span class="number">1rem</span>;</span></span><br><span class="line"><span class="css">            -webkit-appearance: button;</span></span><br><span class="line"><span class="css">            <span class="attribute">cursor</span>: pointer;</span></span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line"><span class="css">            <span class="selector-class">.btn</span><span class="selector-pseudo">:focus</span>,</span></span><br><span class="line"><span class="css">            <span class="selector-class">.btn</span><span class="selector-pseudo">:active</span><span class="selector-pseudo">:focus</span>,</span></span><br><span class="line"><span class="css">            <span class="selector-class">.btn</span><span class="selector-class">.active</span><span class="selector-pseudo">:focus</span>,</span></span><br><span class="line">            .btn.focus,</span><br><span class="line"><span class="css">            <span class="selector-class">.btn</span><span class="selector-pseudo">:active</span><span class="selector-class">.focus</span>,</span></span><br><span class="line">            .btn.active.focus &#123;</span><br><span class="line"><span class="css">                <span class="attribute">outline</span>: none;</span></span><br><span class="line">            &#125;</span><br><span class="line"></span><br><span class="line">        .input-text &#123;</span><br><span class="line"><span class="css">            <span class="attribute">width</span>: <span class="number">4rem</span>;</span></span><br><span class="line"><span class="css">            <span class="attribute">margin-right</span>: <span class="number">1rem</span>;</span></span><br><span class="line">        &#125;</span><br><span class="line">    <span class="tag">&lt;/<span class="name">style</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">title</span>&gt;</span>鼠标工具绘制<span class="tag">&lt;/<span class="name">title</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">head</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&#x27;container&#x27;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&#x27;info&#x27;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">div</span>&gt;</span>操作说明：圆和矩形通过拖拽来绘制，其他覆盖物通过单击来绘制，双击结束绘制<span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">div</span>&gt;</span>当前类型：<span class="tag">&lt;<span class="name">span</span> <span class="attr">id</span>=<span class="string">&quot;type&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">div</span>&gt;</span>坐标信息：<span class="tag">&lt;<span class="name">span</span> <span class="attr">id</span>=<span class="string">&quot;lnglat&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&quot;location&quot;</span>&gt;</span>位置信息： <span class="tag">&lt;<span class="name">span</span> <span class="attr">id</span>=<span class="string">&quot;address&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;input-card&quot;</span> <span class="attr">style</span>=<span class="string">&#x27;width: 24rem;&#x27;</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;input-item&quot;</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&#x27;func&#x27;</span> <span class="attr">checked</span> <span class="attr">value</span>=<span class="string">&#x27;marker&#x27;</span>&gt;</span><span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;input-text&quot;</span>&gt;</span>画点<span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&#x27;func&#x27;</span> <span class="attr">value</span>=<span class="string">&#x27;polyline&#x27;</span>&gt;</span><span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;input-text&quot;</span>&gt;</span>画折线<span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&#x27;func&#x27;</span> <span class="attr">value</span>=<span class="string">&#x27;polygon&#x27;</span>&gt;</span><span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;input-text&quot;</span> <span class="attr">style</span>=<span class="string">&#x27;width:5rem;&#x27;</span>&gt;</span>画多边形<span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;input-item&quot;</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&#x27;func&#x27;</span> <span class="attr">value</span>=<span class="string">&#x27;rectangle&#x27;</span>&gt;</span><span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;input-text&quot;</span>&gt;</span>画矩形<span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&#x27;func&#x27;</span> <span class="attr">value</span>=<span class="string">&#x27;circle&#x27;</span>&gt;</span><span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;input-text&quot;</span>&gt;</span>画圆<span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;input-item&quot;</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">input</span> <span class="attr">id</span>=<span class="string">&quot;clear&quot;</span> <span class="attr">type</span>=<span class="string">&quot;button&quot;</span> <span class="attr">class</span>=<span class="string">&quot;btn&quot;</span> <span class="attr">value</span>=<span class="string">&quot;清除&quot;</span> /&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">input</span> <span class="attr">id</span>=<span class="string">&quot;confirm&quot;</span> <span class="attr">type</span>=<span class="string">&quot;button&quot;</span> <span class="attr">class</span>=<span class="string">&quot;btn&quot;</span> <span class="attr">value</span>=<span class="string">&quot;确定&quot;</span> /&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">&quot;https://webapi.amap.com/maps?v=1.4.15&amp;key=你的key&amp;plugin=AMap.MouseTool&amp;plugin=AMap.PolyEditor&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">&quot;text/javascript&quot;</span>&gt;</span></span><br><span class="line"><span class="javascript">        <span class="keyword">var</span> map = <span class="keyword">new</span> AMap.Map(<span class="string">&#x27;container&#x27;</span>, &#123;</span></span><br><span class="line">            zoom: 13,</span><br><span class="line">            center: [110.255414, 20.009835],</span><br><span class="line">        &#125;);</span><br><span class="line"></span><br><span class="line"><span class="javascript">        <span class="comment">//自定义控件</span></span></span><br><span class="line"><span class="javascript">        AMap.plugin([<span class="string">&#x27;AMap.ToolBar&#x27;</span>, <span class="string">&#x27;AMap.Scale&#x27;</span>, <span class="string">&#x27;AMap.OverView&#x27;</span>, <span class="string">&#x27;AMap.MapType&#x27;</span>], <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">            <span class="comment">//map.addControl(new AMap.ToolBar());</span></span></span><br><span class="line"><span class="javascript">            map.addControl(<span class="keyword">new</span> AMap.Scale());</span></span><br><span class="line"><span class="javascript">            <span class="comment">//map.addControl(new AMap.OverView(&#123; isOpen: true &#125;));</span></span></span><br><span class="line"><span class="javascript">            map.addControl(<span class="keyword">new</span> AMap.MapType(&#123; <span class="attr">defaultType</span>: <span class="number">0</span> &#125;));</span></span><br><span class="line">        &#125;)</span><br><span class="line"></span><br><span class="line"><span class="javascript">        <span class="keyword">var</span> mouseTool = <span class="keyword">new</span> AMap.MouseTool(map);</span></span><br><span class="line"><span class="javascript">        <span class="comment">//监听draw事件可获取画好的覆盖物</span></span></span><br><span class="line"><span class="javascript">        <span class="keyword">var</span> overlays = [];</span></span><br><span class="line"><span class="javascript">        <span class="comment">//结果集</span></span></span><br><span class="line"><span class="javascript">        <span class="keyword">var</span> result = &#123;</span></span><br><span class="line"><span class="javascript">            type: <span class="string">&quot;&quot;</span>,</span></span><br><span class="line">            data: &#123;</span><br><span class="line"><span class="javascript">                location: &#123; <span class="attr">lng</span>: <span class="string">&quot;&quot;</span>, <span class="attr">lat</span>: <span class="string">&quot;&quot;</span> &#125;, <span class="attr">path</span>: [],</span></span><br><span class="line"><span class="javascript">                bounds: &#123; <span class="attr">southwest</span>: &#123; <span class="attr">lng</span>: <span class="string">&quot;&quot;</span>, <span class="attr">lat</span>: <span class="string">&quot;&quot;</span> &#125;, <span class="attr">northeast</span>: &#123; <span class="attr">lng</span>: <span class="string">&quot;&quot;</span>, <span class="attr">lat</span>: <span class="string">&quot;&quot;</span> &#125;, &#125;,</span></span><br><span class="line"><span class="javascript">                circle: &#123; <span class="attr">center</span>: <span class="string">&quot;&quot;</span>, <span class="attr">radius</span>: <span class="string">&quot;&quot;</span> &#125;</span></span><br><span class="line">            &#125;</span><br><span class="line">        &#125;;</span><br><span class="line"><span class="javascript">        mouseTool.on(<span class="string">&#x27;draw&#x27;</span>, <span class="function"><span class="keyword">function</span> (<span class="params">e</span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">            <span class="comment">//清空覆盖物</span></span></span><br><span class="line">            map.remove(overlays);</span><br><span class="line">            overlays = [];</span><br><span class="line"><span class="javascript">            <span class="comment">//根据类型处理地图覆盖物</span></span></span><br><span class="line"><span class="javascript">            <span class="keyword">var</span> lnglat = [];<span class="comment">//单项目点</span></span></span><br><span class="line"><span class="javascript">            <span class="keyword">switch</span> (e.obj.getExtData().type) &#123;</span></span><br><span class="line"><span class="javascript">                <span class="keyword">case</span> <span class="string">&#x27;marker&#x27;</span>: &#123;</span></span><br><span class="line">                    lnglat.push(e.obj.getPosition().lng);</span><br><span class="line">                    lnglat.push(e.obj.getPosition().lat);</span><br><span class="line"><span class="javascript">                    <span class="built_in">document</span>.getElementById(<span class="string">&quot;type&quot;</span>).innerHTML = <span class="string">&quot;marker&quot;</span>;</span></span><br><span class="line"><span class="javascript">                    <span class="built_in">document</span>.getElementById(<span class="string">&quot;lnglat&quot;</span>).innerHTML = lnglat;</span></span><br><span class="line">                    Geocoder(lnglat, e.obj.getExtData().type);</span><br><span class="line">                    overlays.push(e.obj);</span><br><span class="line"><span class="javascript">                    result.type = <span class="string">&#x27;marker&#x27;</span>;</span></span><br><span class="line">                    result.data.location.lng = e.obj.getPosition().lng;</span><br><span class="line">                    result.data.location.lat = e.obj.getPosition().lat;</span><br><span class="line"><span class="javascript">                    <span class="keyword">break</span>;</span></span><br><span class="line">                &#125;;</span><br><span class="line"><span class="javascript">                <span class="keyword">case</span> <span class="string">&#x27;polyline&#x27;</span>: &#123;</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> data = e.obj.getPath();</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; data.length; i++) &#123;</span></span><br><span class="line"><span class="javascript">                        <span class="keyword">var</span> tmp = [];</span></span><br><span class="line">                        tmp.push(data[i].lng);</span><br><span class="line">                        tmp.push(data[i].lat);</span><br><span class="line">                        lnglat.push(tmp);</span><br><span class="line">                        result.data.path.push(tmp);</span><br><span class="line">                    &#125;</span><br><span class="line"><span class="javascript">                    result.type = <span class="string">&#x27;polyline&#x27;</span>;</span></span><br><span class="line"><span class="javascript">                    <span class="built_in">document</span>.getElementById(<span class="string">&quot;type&quot;</span>).innerHTML = <span class="string">&quot;polyline&quot;</span>;</span></span><br><span class="line"><span class="javascript">                    <span class="built_in">document</span>.getElementById(<span class="string">&quot;lnglat&quot;</span>).innerHTML = lnglat;</span></span><br><span class="line"></span><br><span class="line"><span class="javascript">                    <span class="comment">//关闭鼠标绘图工具，true表示清除图形，false保留</span></span></span><br><span class="line"><span class="javascript">                    mouseTool.close(<span class="literal">true</span>);</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> polyline = <span class="keyword">new</span> AMap.Polyline(&#123;</span></span><br><span class="line">                        path: data,</span><br><span class="line"><span class="javascript">                        isOutline: <span class="literal">true</span>,</span></span><br><span class="line"><span class="javascript">                        outlineColor: <span class="string">&#x27;#ffeeff&#x27;</span>,</span></span><br><span class="line">                        borderWeight: 3,</span><br><span class="line"><span class="javascript">                        strokeColor: <span class="string">&quot;#3366FF&quot;</span>,</span></span><br><span class="line">                        strokeOpacity: 1,</span><br><span class="line">                        strokeWeight: 6,</span><br><span class="line"><span class="javascript">                        <span class="comment">// 折线样式还支持 &#x27;dashed&#x27;</span></span></span><br><span class="line"><span class="javascript">                        strokeStyle: <span class="string">&quot;solid&quot;</span>,</span></span><br><span class="line"><span class="javascript">                        <span class="comment">// strokeStyle是dashed时有效</span></span></span><br><span class="line">                        strokeDasharray: [10, 5],</span><br><span class="line"><span class="javascript">                        lineJoin: <span class="string">&#x27;round&#x27;</span>,</span></span><br><span class="line"><span class="javascript">                        lineCap: <span class="string">&#x27;round&#x27;</span>,</span></span><br><span class="line">                        zIndex: 50,</span><br><span class="line"><span class="javascript">                        extData: &#123; <span class="attr">type</span>: <span class="string">&#x27;polyline&#x27;</span> &#125;,</span></span><br><span class="line">                    &#125;)</span><br><span class="line">                    overlays.push(polyline);</span><br><span class="line"><span class="javascript">                    <span class="comment">//地图更新对象</span></span></span><br><span class="line">                    polyline.setMap(map);</span><br><span class="line"><span class="javascript">                    <span class="comment">//启用编辑</span></span></span><br><span class="line"><span class="javascript">                    AMap.plugin([<span class="string">&quot;AMap.PolyEditor&quot;</span>], <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">                        <span class="keyword">var</span> PolylineEditor = <span class="keyword">new</span> AMap.PolyEditor(map, polyline);</span></span><br><span class="line">                        overlays.push(PolylineEditor);</span><br><span class="line">                        PolylineEditor.open();</span><br><span class="line"><span class="javascript">                        <span class="comment">//绑定增加节点事件</span></span></span><br><span class="line"><span class="javascript">                        PolylineEditor.on(<span class="string">&#x27;addnode&#x27;</span>, <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>&#123;</span></span><br><span class="line">                            updateData(event);</span><br><span class="line">                        &#125;)</span><br><span class="line"><span class="javascript">                        <span class="comment">//绑定调整节点事件</span></span></span><br><span class="line"><span class="javascript">                        PolylineEditor.on(<span class="string">&#x27;adjust&#x27;</span>, <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>&#123;</span></span><br><span class="line">                            updateData(event);</span><br><span class="line">                        &#125;)</span><br><span class="line"><span class="javascript">                        <span class="comment">//绑定删除节点事件</span></span></span><br><span class="line"><span class="javascript">                        PolylineEditor.on(<span class="string">&#x27;removenode&#x27;</span>, <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>&#123;</span></span><br><span class="line">                            updateData(event);</span><br><span class="line">                        &#125;)</span><br><span class="line">                    &#125;)</span><br><span class="line"><span class="javascript">                    <span class="keyword">break</span>;</span></span><br><span class="line">                &#125;;</span><br><span class="line"><span class="javascript">                <span class="keyword">case</span> <span class="string">&#x27;polygon&#x27;</span>: &#123;</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> data = e.obj.getPath();</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; data.length; i++) &#123;</span></span><br><span class="line"><span class="javascript">                        <span class="keyword">var</span> tmp = [];</span></span><br><span class="line">                        tmp.push(data[i].lng);</span><br><span class="line">                        tmp.push(data[i].lat);</span><br><span class="line">                        lnglat.push(tmp);</span><br><span class="line">                        result.data.path.push(tmp);</span><br><span class="line">                    &#125;</span><br><span class="line"><span class="javascript">                    result.type = <span class="string">&#x27;polygon&#x27;</span>;</span></span><br><span class="line"><span class="javascript">                    <span class="built_in">document</span>.getElementById(<span class="string">&quot;type&quot;</span>).innerHTML = <span class="string">&quot;polygon&quot;</span>;</span></span><br><span class="line"><span class="javascript">                    <span class="built_in">document</span>.getElementById(<span class="string">&quot;lnglat&quot;</span>).innerHTML = lnglat;</span></span><br><span class="line"></span><br><span class="line"><span class="javascript">                    <span class="comment">//关闭鼠标绘图工具，true表示清除图形，false保留</span></span></span><br><span class="line"><span class="javascript">                    mouseTool.close(<span class="literal">true</span>);</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> polygon = <span class="keyword">new</span> AMap.Polygon(&#123;</span></span><br><span class="line">                        path: data,</span><br><span class="line"><span class="javascript">                        isOutline: <span class="literal">true</span>,</span></span><br><span class="line"><span class="javascript">                        outlineColor: <span class="string">&#x27;#ffeeff&#x27;</span>,</span></span><br><span class="line">                        borderWeight: 3,</span><br><span class="line"><span class="javascript">                        strokeColor: <span class="string">&quot;#3366FF&quot;</span>,</span></span><br><span class="line">                        strokeOpacity: 1,</span><br><span class="line">                        strokeWeight: 6,</span><br><span class="line"><span class="javascript">                        <span class="comment">// 折线样式还支持 &#x27;dashed&#x27;</span></span></span><br><span class="line"><span class="javascript">                        strokeStyle: <span class="string">&quot;solid&quot;</span>,</span></span><br><span class="line"><span class="javascript">                        <span class="comment">// strokeStyle是dashed时有效</span></span></span><br><span class="line">                        strokeDasharray: [10, 5],</span><br><span class="line"><span class="javascript">                        lineJoin: <span class="string">&#x27;round&#x27;</span>,</span></span><br><span class="line"><span class="javascript">                        lineCap: <span class="string">&#x27;round&#x27;</span>,</span></span><br><span class="line">                        zIndex: 50,</span><br><span class="line"><span class="javascript">                        extData: &#123; <span class="attr">type</span>: <span class="string">&#x27;polygon&#x27;</span> &#125;,</span></span><br><span class="line">                    &#125;)</span><br><span class="line">                    overlays.push(polygon);</span><br><span class="line"><span class="javascript">                    <span class="comment">//地图更新对象</span></span></span><br><span class="line">                    polygon.setMap(map);</span><br><span class="line"><span class="javascript">                    <span class="comment">//启用编辑</span></span></span><br><span class="line"><span class="javascript">                    AMap.plugin([<span class="string">&quot;AMap.PolyEditor&quot;</span>], <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">                        <span class="keyword">var</span> PolygonEditor = <span class="keyword">new</span> AMap.PolyEditor(map, polygon);</span></span><br><span class="line">                        overlays.push(PolygonEditor);</span><br><span class="line">                        PolygonEditor.open();</span><br><span class="line"><span class="javascript">                        <span class="comment">//绑定增加节点事件</span></span></span><br><span class="line"><span class="javascript">                        PolygonEditor.on(<span class="string">&#x27;addnode&#x27;</span>, <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>&#123;</span></span><br><span class="line">                            updateData(event);</span><br><span class="line">                        &#125;)</span><br><span class="line"><span class="javascript">                        <span class="comment">//绑定调整节点事件</span></span></span><br><span class="line"><span class="javascript">                        PolygonEditor.on(<span class="string">&#x27;adjust&#x27;</span>, <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>&#123;</span></span><br><span class="line">                            updateData(event);</span><br><span class="line">                        &#125;)</span><br><span class="line"><span class="javascript">                        <span class="comment">//绑定删除节点事件</span></span></span><br><span class="line"><span class="javascript">                        PolygonEditor.on(<span class="string">&#x27;removenode&#x27;</span>, <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>&#123;</span></span><br><span class="line">                            updateData(event);</span><br><span class="line">                        &#125;)</span><br><span class="line">                    &#125;)</span><br><span class="line"><span class="javascript">                    <span class="keyword">break</span>;</span></span><br><span class="line">                &#125;;</span><br><span class="line"><span class="javascript">                <span class="keyword">case</span> <span class="string">&#x27;rectangle&#x27;</span>: &#123;</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> data = e.obj.getBounds();</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> southwestlng = data.southwest.lng;</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> southwestlat = data.southwest.lat;</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> northeastlng = data.northeast.lng;</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> northeastlat = data.northeast.lat;</span></span><br><span class="line"><span class="javascript">                    <span class="built_in">document</span>.getElementById(<span class="string">&quot;type&quot;</span>).innerHTML = <span class="string">&quot;rectangle&quot;</span>;</span></span><br><span class="line"><span class="javascript">                    <span class="built_in">document</span>.getElementById(<span class="string">&quot;lnglat&quot;</span>).innerHTML = <span class="string">&quot;southwest:[&quot;</span> + southwestlng + <span class="string">&quot;,&quot;</span> + southwestlat + <span class="string">&quot;],northeast:[&quot;</span> + northeastlng + <span class="string">&quot;,&quot;</span> + northeastlat + <span class="string">&quot;]&quot;</span>;</span></span><br><span class="line"><span class="javascript">                    result.type = <span class="string">&#x27;polygon&#x27;</span>;</span></span><br><span class="line">                    result.data.bounds.southwest.lng = southwestlng;</span><br><span class="line">                    result.data.bounds.southwest.lat = southwestlat;</span><br><span class="line">                    result.data.bounds.northeast.lng = northeastlng;</span><br><span class="line">                    result.data.bounds.northeast.lat = northeastlat;</span><br><span class="line"><span class="javascript">                    <span class="comment">//关闭鼠标绘图工具，true表示清除图形，false保留</span></span></span><br><span class="line"><span class="javascript">                    mouseTool.close(<span class="literal">true</span>);</span></span><br><span class="line"><span class="javascript">                    <span class="comment">//重新声明矩形对象</span></span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> rectangle = <span class="keyword">new</span> AMap.Rectangle(&#123;</span></span><br><span class="line">                        bounds: data,</span><br><span class="line"><span class="javascript">                        strokeColor: <span class="string">&#x27;red&#x27;</span>,</span></span><br><span class="line">                        strokeWeight: 6,</span><br><span class="line">                        strokeOpacity: 0.5,</span><br><span class="line">                        strokeDasharray: [30, 10],</span><br><span class="line"><span class="javascript">                        <span class="comment">// strokeStyle还支持 solid</span></span></span><br><span class="line"><span class="javascript">                        strokeStyle: <span class="string">&#x27;dashed&#x27;</span>,</span></span><br><span class="line"><span class="javascript">                        fillColor: <span class="string">&#x27;blue&#x27;</span>,</span></span><br><span class="line">                        fillOpacity: 0.5,</span><br><span class="line"><span class="javascript">                        cursor: <span class="string">&#x27;pointer&#x27;</span>,</span></span><br><span class="line">                        zIndex: 50,</span><br><span class="line"><span class="javascript">                        extData: &#123; <span class="attr">type</span>: <span class="string">&#x27;rectangle&#x27;</span> &#125;,</span></span><br><span class="line">                    &#125;)</span><br><span class="line">                    overlays.push(rectangle);</span><br><span class="line"><span class="javascript">                    <span class="comment">//地图更新对象</span></span></span><br><span class="line">                    rectangle.setMap(map);</span><br><span class="line"><span class="javascript">                    <span class="comment">//启用编辑</span></span></span><br><span class="line"><span class="javascript">                    AMap.plugin([<span class="string">&quot;AMap.RectangleEditor&quot;</span>], <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">                        <span class="keyword">var</span> RectangleEditor = <span class="keyword">new</span> AMap.RectangleEditor(map, rectangle);</span></span><br><span class="line">                        overlays.push(RectangleEditor);</span><br><span class="line">                        RectangleEditor.open();</span><br><span class="line"><span class="javascript">                        RectangleEditor.on(<span class="string">&#x27;adjust&#x27;</span>, <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>&#123;</span></span><br><span class="line">                            updateData(event);</span><br><span class="line">                        &#125;)</span><br><span class="line">                    &#125;)</span><br><span class="line"><span class="javascript">                    <span class="keyword">break</span>;</span></span><br><span class="line">                &#125;;</span><br><span class="line"><span class="javascript">                <span class="keyword">case</span> <span class="string">&#x27;circle&#x27;</span>: &#123;</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> radius = e.obj.getRadius();</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> center = e.obj.getCenter();</span></span><br><span class="line"><span class="javascript">                    <span class="built_in">document</span>.getElementById(<span class="string">&quot;type&quot;</span>).innerHTML = <span class="string">&quot;circle&quot;</span>;</span></span><br><span class="line"><span class="javascript">                    <span class="built_in">document</span>.getElementById(<span class="string">&quot;lnglat&quot;</span>).innerHTML = <span class="string">&quot;圆心：&quot;</span> + center + <span class="string">&quot;半径：&quot;</span> + radius;</span></span><br><span class="line"><span class="javascript">                    result.type = <span class="string">&#x27;circle&#x27;</span>;</span></span><br><span class="line">                    result.data.circle.center = center;</span><br><span class="line">                    result.data.circle.radius = radius;</span><br><span class="line"><span class="javascript">                    <span class="comment">//关闭鼠标绘图工具，true表示清除图形，false保留</span></span></span><br><span class="line"><span class="javascript">                    mouseTool.close(<span class="literal">true</span>);</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> circle = <span class="keyword">new</span> AMap.Circle(&#123;</span></span><br><span class="line"><span class="javascript">                        <span class="comment">//map: mapObj,</span></span></span><br><span class="line">                        center: center,</span><br><span class="line">                        radius: radius,</span><br><span class="line"><span class="javascript">                        strokeColor: <span class="string">&quot;#F33&quot;</span>,</span></span><br><span class="line">                        strokeOpacity: 1,</span><br><span class="line">                        strokeWeight: 3,</span><br><span class="line"><span class="javascript">                        fillColor: <span class="string">&quot;ee2200&quot;</span>,</span></span><br><span class="line">                        fillOpacity: 0.35,</span><br><span class="line"><span class="javascript">                        extData: &#123; <span class="attr">type</span>: <span class="string">&#x27;circle&#x27;</span> &#125;,</span></span><br><span class="line">                    &#125;);</span><br><span class="line">                    overlays.push(circle);</span><br><span class="line"><span class="javascript">                    <span class="comment">//地图更新对象</span></span></span><br><span class="line">                    circle.setMap(map);</span><br><span class="line"><span class="javascript">                    <span class="comment">//启用编辑</span></span></span><br><span class="line"><span class="javascript">                    AMap.plugin([<span class="string">&quot;AMap.CircleEditor&quot;</span>], <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">                        <span class="keyword">var</span> CircleEditor = <span class="keyword">new</span> AMap.CircleEditor(map, circle);</span></span><br><span class="line">                        overlays.push(CircleEditor);</span><br><span class="line">                        CircleEditor.open();</span><br><span class="line"><span class="javascript">                        CircleEditor.on(<span class="string">&#x27;move&#x27;</span>, <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>&#123;</span></span><br><span class="line">                            updateData(event);</span><br><span class="line">                        &#125;)</span><br><span class="line"><span class="javascript">                        CircleEditor.on(<span class="string">&#x27;adjust&#x27;</span>, <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>&#123;</span></span><br><span class="line">                            updateData(event);</span><br><span class="line">                        &#125;)</span><br><span class="line">                    &#125;);</span><br><span class="line"><span class="javascript">                    <span class="keyword">break</span>;</span></span><br><span class="line">                &#125;;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;)</span><br><span class="line"></span><br><span class="line"><span class="javascript">        <span class="comment">//绘制图形</span></span></span><br><span class="line"><span class="javascript">        <span class="function"><span class="keyword">function</span> <span class="title">draw</span>(<span class="params">type</span>) </span>&#123;</span></span><br><span class="line"></span><br><span class="line"><span class="javascript">            <span class="comment">//清空上一次覆盖物</span></span></span><br><span class="line"><span class="javascript">            <span class="comment">//不是点需要先通过编辑工具关闭</span></span></span><br><span class="line">            if (overlays.length &gt; 0) &#123;</span><br><span class="line"><span class="javascript">                <span class="keyword">if</span> (overlays[<span class="number">0</span>].getExtData().type != <span class="string">&#x27;marker&#x27;</span>) &#123;</span></span><br><span class="line">                    overlays[1].close();</span><br><span class="line">                &#125;</span><br><span class="line">                map.remove(overlays[0]);</span><br><span class="line">                overlays = [];</span><br><span class="line">            &#125;</span><br><span class="line"><span class="javascript">            <span class="built_in">document</span>.getElementById(<span class="string">&quot;type&quot;</span>).innerHTML = <span class="string">&quot;&quot;</span>;</span></span><br><span class="line"><span class="javascript">            <span class="built_in">document</span>.getElementById(<span class="string">&quot;lnglat&quot;</span>).innerHTML = <span class="string">&quot;&quot;</span>;</span></span><br><span class="line"><span class="javascript">            <span class="built_in">document</span>.getElementById(<span class="string">&quot;address&quot;</span>).innerHTML = <span class="string">&quot;&quot;</span>;</span></span><br><span class="line"></span><br><span class="line"><span class="javascript">            <span class="keyword">if</span> (type == <span class="string">&#x27;marker&#x27;</span>)</span></span><br><span class="line"><span class="javascript">                <span class="built_in">document</span>.getElementById(<span class="string">&quot;location&quot;</span>).style.display = <span class="string">&quot;&quot;</span>;</span></span><br><span class="line"><span class="javascript">            <span class="keyword">else</span></span></span><br><span class="line"><span class="javascript">                <span class="built_in">document</span>.getElementById(<span class="string">&quot;location&quot;</span>).style.display = <span class="string">&quot;none&quot;</span>;</span></span><br><span class="line"><span class="javascript">            <span class="keyword">switch</span> (type) &#123;</span></span><br><span class="line"><span class="javascript">                <span class="keyword">case</span> <span class="string">&#x27;marker&#x27;</span>: &#123;</span></span><br><span class="line">                    mouseTool.marker(&#123;</span><br><span class="line"><span class="javascript">                        <span class="comment">//同Marker的Option设置</span></span></span><br><span class="line"><span class="javascript">                        <span class="comment">//draggable: true,</span></span></span><br><span class="line"><span class="javascript">                        <span class="comment">//类型参数，用作区分</span></span></span><br><span class="line"><span class="javascript">                        extData: &#123; <span class="attr">type</span>: <span class="string">&#x27;marker&#x27;</span> &#125;,</span></span><br><span class="line">                    &#125;);</span><br><span class="line"><span class="javascript">                    <span class="keyword">break</span>;</span></span><br><span class="line">                &#125;</span><br><span class="line"><span class="javascript">                <span class="keyword">case</span> <span class="string">&#x27;polyline&#x27;</span>: &#123;</span></span><br><span class="line">                    mouseTool.polyline(&#123;</span><br><span class="line"><span class="javascript">                        <span class="comment">//同Polyline的Option设置</span></span></span><br><span class="line"><span class="javascript">                        strokeColor: <span class="string">&#x27;#80d8ff&#x27;</span>,</span></span><br><span class="line">                        strokeWeight: 6,</span><br><span class="line"><span class="javascript">                        extData: &#123; <span class="attr">type</span>: <span class="string">&#x27;polyline&#x27;</span> &#125;,</span></span><br><span class="line">                    &#125;);</span><br><span class="line"><span class="javascript">                    <span class="keyword">break</span>;</span></span><br><span class="line">                &#125;</span><br><span class="line"><span class="javascript">                <span class="keyword">case</span> <span class="string">&#x27;polygon&#x27;</span>: &#123;</span></span><br><span class="line">                    mouseTool.polygon(&#123;</span><br><span class="line"><span class="javascript">                        <span class="comment">//同Polygon的Option设置</span></span></span><br><span class="line"><span class="javascript">                        fillColor: <span class="string">&#x27;#00b0ff&#x27;</span>,</span></span><br><span class="line"><span class="javascript">                        strokeColor: <span class="string">&#x27;#80d8ff&#x27;</span>,</span></span><br><span class="line"><span class="javascript">                        extData: &#123; <span class="attr">type</span>: <span class="string">&#x27;polygon&#x27;</span> &#125;</span></span><br><span class="line">                    &#125;);</span><br><span class="line"><span class="javascript">                    <span class="keyword">break</span>;</span></span><br><span class="line">                &#125;</span><br><span class="line"><span class="javascript">                <span class="keyword">case</span> <span class="string">&#x27;rectangle&#x27;</span>: &#123;</span></span><br><span class="line">                    mouseTool.rectangle(&#123;</span><br><span class="line"><span class="javascript">                        <span class="comment">//同Polygon的Option设置</span></span></span><br><span class="line"><span class="javascript">                        fillColor: <span class="string">&#x27;#00b0ff&#x27;</span>,</span></span><br><span class="line"><span class="javascript">                        strokeColor: <span class="string">&#x27;#80d8ff&#x27;</span>,</span></span><br><span class="line"><span class="javascript">                        extData: &#123; <span class="attr">type</span>: <span class="string">&#x27;rectangle&#x27;</span> &#125;</span></span><br><span class="line">                    &#125;);</span><br><span class="line"><span class="javascript">                    <span class="keyword">break</span>;</span></span><br><span class="line">                &#125;</span><br><span class="line"><span class="javascript">                <span class="keyword">case</span> <span class="string">&#x27;circle&#x27;</span>: &#123;</span></span><br><span class="line">                    mouseTool.circle(&#123;</span><br><span class="line"><span class="javascript">                        <span class="comment">//同Circle的Option设置</span></span></span><br><span class="line"><span class="javascript">                        fillColor: <span class="string">&#x27;#00b0ff&#x27;</span>,</span></span><br><span class="line"><span class="javascript">                        strokeColor: <span class="string">&#x27;#80d8ff&#x27;</span>,</span></span><br><span class="line"><span class="javascript">                        extData: &#123; <span class="attr">type</span>: <span class="string">&#x27;circle&#x27;</span> &#125;</span></span><br><span class="line">                    &#125;);</span><br><span class="line"><span class="javascript">                    <span class="keyword">break</span>;</span></span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line"><span class="javascript">        <span class="keyword">var</span> radios = <span class="built_in">document</span>.getElementsByName(<span class="string">&#x27;func&#x27;</span>);</span></span><br><span class="line"><span class="javascript">        <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; radios.length; i++) &#123;</span></span><br><span class="line"><span class="javascript">            radios[i].onchange = <span class="function"><span class="keyword">function</span> (<span class="params">e</span>) </span>&#123;</span></span><br><span class="line">                draw(e.target.value)</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"><span class="javascript">        <span class="comment">//默认画点</span></span></span><br><span class="line"><span class="javascript">        draw(<span class="string">&#x27;marker&#x27;</span>);</span></span><br><span class="line"></span><br><span class="line"><span class="javascript">        <span class="comment">//逆地理编码</span></span></span><br><span class="line"><span class="javascript">        <span class="function"><span class="keyword">function</span> <span class="title">Geocoder</span>(<span class="params">lnglat, type</span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">            AMap.plugin(<span class="string">&#x27;AMap.Geocoder&#x27;</span>, <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">                <span class="keyword">var</span> geocoder = <span class="keyword">new</span> AMap.Geocoder(&#123;</span></span><br><span class="line"><span class="javascript">                    <span class="comment">// city 指定进行编码查询的城市，支持传入城市名、adcode 和 citycode</span></span></span><br><span class="line"><span class="javascript">                    <span class="comment">// city: &#x27;010&#x27;</span></span></span><br><span class="line">                    radius: 1000,</span><br><span class="line"><span class="javascript">                    extensions: <span class="string">&quot;all&quot;</span></span></span><br><span class="line">                &#125;)</span><br><span class="line"><span class="javascript">                geocoder.getAddress(lnglat, <span class="function"><span class="keyword">function</span> (<span class="params">status, result</span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">if</span> (status === <span class="string">&#x27;complete&#x27;</span> &amp;&amp; result.info === <span class="string">&#x27;OK&#x27;</span>) &#123;</span></span><br><span class="line"><span class="javascript">                        <span class="comment">// result为对应的地理位置详细信息</span></span></span><br><span class="line"><span class="javascript">                        <span class="built_in">document</span>.getElementById(<span class="string">&quot;address&quot;</span>).innerHTML = result.regeocode.formattedAddress;</span></span><br><span class="line"></span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;)</span><br><span class="line">            &#125;)</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line"><span class="javascript">        <span class="comment">//编辑事件绑定方法，实时更新左上角数据</span></span></span><br><span class="line"><span class="javascript">        <span class="function"><span class="keyword">function</span> <span class="title">updateData</span>(<span class="params">event</span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">            <span class="keyword">var</span> data;</span></span><br><span class="line"><span class="javascript">            <span class="keyword">if</span> (overlays[<span class="number">0</span>].getExtData().type == <span class="string">&quot;polyline&quot;</span> || overlays[<span class="number">0</span>].getExtData().type == <span class="string">&quot;polygon&quot;</span>) &#123;</span></span><br><span class="line">                data = overlays[0].getPath();</span><br><span class="line"><span class="javascript">                <span class="keyword">var</span> lnglat = [];</span></span><br><span class="line"><span class="javascript">                <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; data.length; i++) &#123;</span></span><br><span class="line"><span class="javascript">                    <span class="keyword">var</span> tmp = [];</span></span><br><span class="line">                    tmp.push(data[i].lng);</span><br><span class="line">                    tmp.push(data[i].lat);</span><br><span class="line">                    lnglat.push(tmp);</span><br><span class="line">                &#125;</span><br><span class="line"><span class="javascript">                <span class="built_in">document</span>.getElementById(<span class="string">&quot;type&quot;</span>).innerHTML = <span class="string">&quot;polygon&quot;</span>;</span></span><br><span class="line"><span class="javascript">                <span class="built_in">document</span>.getElementById(<span class="string">&quot;lnglat&quot;</span>).innerHTML = lnglat;</span></span><br><span class="line"><span class="javascript">            &#125; <span class="keyword">else</span> <span class="keyword">if</span> (overlays[<span class="number">0</span>].getExtData().type == <span class="string">&quot;rectangle&quot;</span>) &#123;</span></span><br><span class="line">                data = overlays[0].getBounds();</span><br><span class="line"><span class="javascript">                <span class="built_in">document</span>.getElementById(<span class="string">&quot;lnglat&quot;</span>).innerHTML = <span class="string">&quot;southwest:[&quot;</span> + data.southwest.lng + <span class="string">&quot;,&quot;</span> + data.southwest.lat</span></span><br><span class="line"><span class="javascript">                    + <span class="string">&quot;],northeast:[&quot;</span> + data.northeast.lng + <span class="string">&quot;,&quot;</span> + data.northeast.lat + <span class="string">&quot;]&quot;</span>;</span></span><br><span class="line"><span class="javascript">            &#125; <span class="keyword">else</span> <span class="keyword">if</span> (overlays[<span class="number">0</span>].getExtData().type == <span class="string">&quot;circle&quot;</span>) &#123;</span></span><br><span class="line"><span class="javascript">                <span class="built_in">document</span>.getElementById(<span class="string">&quot;lnglat&quot;</span>).innerHTML = <span class="string">&quot;圆心：&quot;</span> + overlays[<span class="number">0</span>].getCenter() + <span class="string">&quot;半径：&quot;</span> + overlays[<span class="number">0</span>].getRadius();</span></span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line"><span class="javascript">        <span class="comment">//清除</span></span></span><br><span class="line"><span class="javascript">        <span class="built_in">document</span>.getElementById(<span class="string">&#x27;clear&#x27;</span>).onclick = <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">            <span class="comment">//不是点需要先关闭编辑工具</span></span></span><br><span class="line">            if (overlays.length &gt; 0) &#123;</span><br><span class="line"><span class="javascript">                <span class="keyword">if</span> (overlays[<span class="number">0</span>].getExtData().type != <span class="string">&#x27;marker&#x27;</span>) &#123;</span></span><br><span class="line">                    overlays[1].close();</span><br><span class="line">                &#125;</span><br><span class="line">                map.remove(overlays[0]);</span><br><span class="line">                draw(overlays[0].getExtData().type);</span><br><span class="line">            &#125;</span><br><span class="line">            overlays = [];</span><br><span class="line">        &#125;</span><br><span class="line"><span class="javascript">        <span class="comment">//确认，自定义保存结果</span></span></span><br><span class="line"><span class="javascript">        <span class="built_in">document</span>.getElementById(<span class="string">&#x27;confirm&#x27;</span>).onclick = <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">            alert(<span class="built_in">JSON</span>.stringify(result));</span></span><br><span class="line"><span class="javascript">            <span class="built_in">console</span>.log(<span class="built_in">JSON</span>.stringify(result));</span></span><br><span class="line">        &#125;</span><br><span class="line">    <span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure>





</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">方陈勇</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://fangchenyong.top/2019/12/19/%E5%9C%B0%E5%9B%BE-%E9%AB%98%E5%BE%B7%E5%9C%B0%E5%9B%BE%E7%94%BB%E7%82%B9%E3%80%81%E6%8A%98%E7%BA%BF%E3%80%81%E5%A4%9A%E8%BE%B9%E5%BD%A2%E3%80%81%E9%95%BF%E6%96%B9%E5%BD%A2%E3%80%81%E5%9C%86/">http://fangchenyong.top/2019/12/19/%E5%9C%B0%E5%9B%BE-%E9%AB%98%E5%BE%B7%E5%9C%B0%E5%9B%BE%E7%94%BB%E7%82%B9%E3%80%81%E6%8A%98%E7%BA%BF%E3%80%81%E5%A4%9A%E8%BE%B9%E5%BD%A2%E3%80%81%E9%95%BF%E6%96%B9%E5%BD%A2%E3%80%81%E5%9C%86/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://fangchenyong.top" target="_blank">Joey</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E5%9C%B0%E5%9B%BE/">地图</a><a class="post-meta__tags" href="/tags/%E9%AB%98%E5%BE%B7%E5%9C%B0%E5%9B%BE/">高德地图</a></div><div class="post_share"><div class="social-share" data-image="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2020/02/10/%E6%95%B0%E6%8D%AE%E5%BA%93-MySQL-MySQL%E5%9F%BA%E7%A1%80/"><img class="prev-cover" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">MySQL基础</div></div></a></div><div class="next-post pull-right"><a href="/2019/11/06/JS-JsPlumb%E7%BB%98%E5%88%B6%E6%B5%81%E7%A8%8B%E5%9B%BE/"><img class="next-cover" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">jsplumb绘制流程图</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2019/10/15/地图-腾讯地图坐标拾取器/" title="腾讯地图坐标选取器"><img class="cover" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-10-15</div><div class="title">腾讯地图坐标选取器</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/3FD9B055-6361-49B7-B8CE-5BA9144BD27F.JPG" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">方陈勇</div><div class="author-info__description">一路向前</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">40</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">47</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">49</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/fangchenyong"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/fangchenyong" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:1013659102@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">个人笔记，如有疑问请联系 QQ:1013659102。</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%AB%98%E5%BE%B7%E5%9C%B0%E5%9B%BE%E7%BB%98%E5%88%B6%E7%9F%A2%E9%87%8F%E5%9B%BE"><span class="toc-number">1.</span> <span class="toc-text">高德地图绘制矢量图</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%9C%B0%E5%9B%BE%E5%9D%90%E6%A0%87%E9%80%89%E5%8F%96%E5%99%A8"><span class="toc-number">2.</span> <span class="toc-text">地图坐标选取器</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2021/03/21/%E9%9D%A2%E8%AF%95-%E5%B9%B6%E5%8F%91%E3%80%81%E5%A4%9A%E7%BA%BF%E7%A8%8B/" title="面试题-并发编程"><img src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="面试题-并发编程"/></a><div class="content"><a class="title" href="/2021/03/21/%E9%9D%A2%E8%AF%95-%E5%B9%B6%E5%8F%91%E3%80%81%E5%A4%9A%E7%BA%BF%E7%A8%8B/" title="面试题-并发编程">面试题-并发编程</a><time datetime="2021-03-20T16:00:00.000Z" title="发表于 2021-03-21 00:00:00">2021-03-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/03/20/%E9%9D%A2%E8%AF%95-%E9%9B%86%E5%90%88/" title="面试题-集合框架"><img src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="面试题-集合框架"/></a><div class="content"><a class="title" href="/2021/03/20/%E9%9D%A2%E8%AF%95-%E9%9B%86%E5%90%88/" title="面试题-集合框架">面试题-集合框架</a><time datetime="2021-03-19T16:00:00.000Z" title="发表于 2021-03-20 00:00:00">2021-03-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/03/20/Java-%E6%BA%90%E7%A0%81-JDK8-HashMap/" title="JDK8 HashMap源码"><img src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JDK8 HashMap源码"/></a><div class="content"><a class="title" href="/2021/03/20/Java-%E6%BA%90%E7%A0%81-JDK8-HashMap/" title="JDK8 HashMap源码">JDK8 HashMap源码</a><time datetime="2021-03-19T16:00:00.000Z" title="发表于 2021-03-20 00:00:00">2021-03-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/03/13/The%20Road%20To%20Bald%20Man!/" title="The Road To Bald Man!"><img src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="The Road To Bald Man!"/></a><div class="content"><a class="title" href="/2021/03/13/The%20Road%20To%20Bald%20Man!/" title="The Road To Bald Man!">The Road To Bald Man!</a><time datetime="2021-03-12T16:00:00.000Z" title="发表于 2021-03-13 00:00:00">2021-03-13</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2020/07/21/%E6%A1%86%E6%9E%B6-Maven-%E9%85%8D%E7%BD%AE%E6%A0%87%E7%AD%BE%E8%AF%A6%E8%A7%A3/" title="Maven配置标签详解"><img src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Maven配置标签详解"/></a><div class="content"><a class="title" href="/2020/07/21/%E6%A1%86%E6%9E%B6-Maven-%E9%85%8D%E7%BD%AE%E6%A0%87%E7%AD%BE%E8%AF%A6%E8%A7%A3/" title="Maven配置标签详解">Maven配置标签详解</a><time datetime="2020-07-20T16:00:00.000Z" title="发表于 2020-07-21 00:00:00">2020-07-21</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG')"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2021 By 方陈勇</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">人生没有退路！</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><div class="js-pjax"></div><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-nest.min.js"></script></div></body></html>